{% extends "./base.html" %}
{% load comment_block %}


{% block title %}
    {% if tag %}
    标签页：{{ tag.name }}
    {% elif category %}
    分类页：{{ category.name }}
    {% else %}
    首页
    {% endif %}
{% endblock %}

{% block extra_head %}
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/googlecode.min.css">
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{% endblock%}

{% block main %}


    {% if post %}
    <!--<div class="card post">-->
        <div class="body">
            <!--<h1 class="card-title"><a href="{% url 'post-detail' post.id %} ">{{ post.title }}</a></h1>-->
            <h2 class="card-title">{{ post.title }}</h2>
            <span class="card-link">作者：<a href="#">{{ post.owner.username }}</a></span>
            <span class="card-link">分类：<a href="{% url 'category-list' post.category.id %}">{{ post.category.name }}</a></span>
            <span class="card-link">标签：
                {% for tag in post.tag.all %}
                <a href="{% url 'tag-list' tag.id %}">{{ tag.name }}</a>
                {% endfor %}
            </span>
            <!--<p class="card-text">{{ post.desc }}<a href="{% url 'post-detail' post.id %}">完整内容</a></p>-->
            <hr/>
            <p>
                {{ post.content }}
            </p>
        </div>
    <!--</div>-->


    {% endif %}

    {% comment_block request.path %}
<!--
<div class="comment">
    <form class="form-group" action="/comment/" method="POST">
        {% csrf_token %}
        <input name="target" type="hidden" value="{{ request.path }}"/>
        {{ comment_form }}
        <input type="submit" value="写好了！"/>
    </form>
    
    <ul class="list-group">
        {% for comment in comment_list %}
        <li class="list-group-item">
            <div class="nickname">
                <a href="{{ comment.website }}">{{ comment.nickname }}</a>
                <span>{{ comment.created_time }}</span>
            </div>
            <div class="comment-content">
                {{ comment.content }}
            </div>
        </li>
        {% endfor %}
    </ul>
</div>
-->

{% endblock %}